package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TowerGoodsMapper;
import com.ruoyi.system.domain.TowerGoods;
import com.ruoyi.system.service.ITowerGoodsService;

/**
 * 塔商品实体Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-01
 */
@Service
public class TowerGoodsServiceImpl implements ITowerGoodsService 
{
    @Autowired
    private TowerGoodsMapper towerGoodsMapper;

    /**
     * 查询塔商品实体
     * 
     * @param id 塔商品实体主键
     * @return 塔商品实体
     */
    @Override
    public TowerGoods selectTowerGoodsById(Long id)
    {
        return towerGoodsMapper.selectTowerGoodsById(id);
    }

    /**
     * 查询塔商品实体列表
     * 
     * @param towerGoods 塔商品实体
     * @return 塔商品实体
     */
    @Override
    public List<TowerGoods> selectTowerGoodsList(TowerGoods towerGoods)
    {
        return towerGoodsMapper.selectTowerGoodsList(towerGoods);
    }

    /**
     * 新增塔商品实体
     * 
     * @param towerGoods 塔商品实体
     * @return 结果
     */
    @Override
    public int insertTowerGoods(TowerGoods towerGoods)
    {
        towerGoods.setCreateTime(DateUtils.getNowDate());
        return towerGoodsMapper.insertTowerGoods(towerGoods);
    }

    /**
     * 修改塔商品实体
     * 
     * @param towerGoods 塔商品实体
     * @return 结果
     */
    @Override
    public int updateTowerGoods(TowerGoods towerGoods)
    {
        towerGoods.setUpdateTime(DateUtils.getNowDate());
        return towerGoodsMapper.updateTowerGoods(towerGoods);
    }

    /**
     * 批量删除塔商品实体
     * 
     * @param ids 需要删除的塔商品实体主键
     * @return 结果
     */
    @Override
    public int deleteTowerGoodsByIds(Long[] ids)
    {
        return towerGoodsMapper.deleteTowerGoodsByIds(ids);
    }

    /**
     * 删除塔商品实体信息
     * 
     * @param id 塔商品实体主键
     * @return 结果
     */
    @Override
    public int deleteTowerGoodsById(Long id)
    {
        return towerGoodsMapper.deleteTowerGoodsById(id);
    }
}
